package cook

class IngredientItem {


	Ingredient ingredient
	BigDecimal quantity
	boolean deleted
	
	static transients = [ 'deleted']
	
    static mapping = {
    }
    
	static constraints = {
		ingredient nullable:false
		quantity min:0.0
    }
	
	public BigDecimal getCost(){
		return quantity*ingredient.cost
	}
	
	public String toString() {
		return quantity +" X " +ingredient.toString();
	}
}
